package com.gonsin.gview.model.dynamic.form;

import com.gonsin.gview.model.GFormItemModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@ApiModel("隐藏框")
@AllArgsConstructor
@NoArgsConstructor
public class DynamicHidden extends DynamicFormItem {

    @ApiModelProperty("text_input表示文本框，还有check_box\\file\\radio\\rich_text\\text_input\\tree_check_box\\tree_selector")
    private final String itemType = "hidden";

    @ApiModelProperty("查询或者提交表单时，表示  ${keyName}=value")
    private String keyName;

    @ApiModelProperty("查询或者提交表单时，表示  ${keyName}=value")
    private String valueName;



    public static DynamicHiddenBuilder builder() {
        return new DynamicHiddenBuilder();
    }
    public static final class DynamicHiddenBuilder {
        @ApiModelProperty("查询或者提交表单时，表示  ${keyName}=value")
        private String keyName;

        @ApiModelProperty("查询或者提交表单时，表示  ${keyName}=value")
        private String valueName;

        private DynamicHiddenBuilder() {
        }

        public DynamicHiddenBuilder keyName(String keyName) {
            this.keyName = keyName;
            return this;
        }

        public DynamicHiddenBuilder valueName(String valueName) {
            this.valueName = valueName;
            return this;
        }

        public DynamicHidden build() {
            DynamicHidden dynamicHidden = new DynamicHidden();
            dynamicHidden.setKeyName(keyName);
            dynamicHidden.setValueName(valueName);
            return dynamicHidden;
        }
    }
}
